package battleship.model;
/**
 * Cell class for each of the 200 cells in the game
 * 
 * @version 1.0 
 * @author Cameron McLeod
 * 
 */
public class Cell {
	private int ship;
	private boolean Occupied, FiredAt;
	private String shipName;

	/**
	 * Initializes the cell.
	 */
	public Cell(){
		Occupied = false;
		FiredAt = false;
		shipName = "";

	}
	/** checks if the cell is occupied
	 * @return if the cell is occupied
	 */
	public boolean IsOccupied(){
		return Occupied;
	}
	/**
	 * Checks if its fired at
	 * @return if this cell has been fired at
	 */
	public boolean IsFiredAt(){
		return FiredAt;
	}
	/**
	 * Checks if the spot is a hit
	 * @return if the cell has a ship and has been hit
	 */
	public boolean Hit(){
		return (FiredAt && Occupied);
	}
	/**
	 * Occupy the cell with a ship
	 * @param name the name of the ship thats been placed
	 * 
	 */
	public void Occupy(String name){
		shipName = name;
		Occupied = true;
	}
	/**
	 * Same as Occupy; but changes the ship name (possibly depreciated?)
	 * @param ship
	 */
	public void setShipName(String ship){
		shipName = ship;
	}
	/**
	 * 
	 * @return the ship's name if there is one
	 */
	public String shipName(){
		return shipName;
	}
	/**
	 *  Fire at the cell
	 */
	public void FireAt(){
		FiredAt = true;
	}
	/**
	 * Gets the ship id
	 * @return the ship ID
	 */
	public int Ship(){
		return ship;
	}
	/**
	 *  Set the ship ID
	 */
	public void Ship(int S){
		ship = S;
	}
	//IsOccupied (bool)
	//IsFiredAt (bool)
	//Owner (Bool)- this can be done in Grid.java (saved 100 variables)
	
}


/*
	Battleship Process:
	CPU or Opponent?
	
	Title
	VS Human/CPU
	Game
	Win
	Lose
	
*/